﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace JingPan.CarRentalService.Contracts
{
    //// 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“Service1”。
    //public class CarrentalService : ICarRentalService
    //{
    //    public string GetData(int value)
    //    {
    //        return string.Format("You entered: {0}", value);
    //    }

    //    public CompositeType GetDataUsingDataContract(CompositeType composite)
    //    {
    //        if (composite == null)
    //        {
    //            throw new ArgumentNullException("composite");
    //        }
    //        if (composite.BoolValue)
    //        {
    //            composite.StringValue += "Suffix";
    //        }
    //        return composite;
    //    }
    //}

    public class CarRentalService : ICarRentalService
    {
        public double CalculatePrice(DateTime pickupDate, DateTime returnDate, string pickupLocation, string vehiclePreference)
        {
            Random r = new Random(DateTime.Now.Millisecond);
            return r.NextDouble() * 500;
        }

        public double CalculatePrice(string pickupLocation, string vehiclePreference)
        {
            throw new NotImplementedException();
        }

        public PriceCalculationResponse CalculatePrice(PriceCalculationRequest request)
        {
            throw new NotImplementedException();
        }

        public void UpdatePrice(string vehicheId, double newPrice)
        {
            throw new NotImplementedException();
        }
    }
}
